
##### java home
JAVA_HOME=/usr/java/jdk
##### project logs
PRJ_LOGS=/opt/tomcat/logs
##### project GC logs
PRJ_GC_LOG_FILE=${PRJ_LOGS}/etcpms_gc.log

##### jvm heap opts
##### Use [-Xms, -Xmx] set heap size. use -Xmn set New Generation size, equals [-XX:NewSize, -XX:MaxNewSize].
##### Use -XX:MetaspaceSize set when Metaspace GC, use -XX:MaxMetaspaceSize set Metaspace's maximum size.
HEAP_OPTS="-server -Xms4g -Xmx4g"

##### jmx opts
RMIHOST=Aaron
RMIPORT=53114
JMX_OPTS="-Djava.rmi.server.hostname=$RMIHOST \
-Dcom.sun.management.jmxremote.port=$RMIPORT \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.authenticate=true \
-Dcom.sun.management.jmxremote.access.file=${JAVA_HOME}/jre/lib/management/jmxremote.access \
-Dcom.sun.management.jmxremote.password.file=${JAVA_HOME}/jre/lib/management/jmxremote.password"

##### gc opts
GC_OPTS="-Xloggc:$PRJ_GC_LOG_FILE \
-XX:+PrintGCDetails \
-XX:+PrintHeapAtGC \
-XX:+PrintGCDateStamps \
-XX:+UseGCLogFileRotation \
-XX:GCLogFileSize=2M \
-XX:NumberOfGCLogFiles=10"

##### heapdump opts
HEAPDUMP_OPTS="-XX:-HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=$PRJ_LOGS/hs_heapdp_%p.hprof \
-XX:ErrorFile=$PRJ_LOGS/hs_err_%p.log"

##### all of above opts
JAVA_OPTS="$HEAP_OPTS $JMX_OPTS $GC_OPTS $HEAPDUMP_OPTS"

